The MMIQ device is need to create a human-machine interface system (HMI) programmable using the development environment Qpaint.
The device provides a range of information on the interface panel with a speed of update can be set by means of the sampling time.
In the configuration unit, in the BUS section, must be declared an instrument whose firmware contains the MMIQ device.
In the INTDEVICE section must be add the following definition:
;--------------------------------- ; Internal device declaration ;--------------------------------- INTDEVICE <device name> MMIQ TCamp
where:
| <device name> | The name assigned to the device. |
| MMIQ | Keyword that identifies the device. |
| Tcamp | Time sampling device (1÷10 ms). |
;-------------------------------- ; Internal device declaration ;-------------------------------- INTDEVICE DEV MMIQ 0001
The key and keyf parameters are used to recognise which key was pressed. The values associated with each key are given in the chapter of this manual “Commands and parameters”.
Any bit of the key and keyf parameters is associated with a button, so if you want to determine the pressing of several keys it helps to check that these parameters assume a value equal to the sum of the values associated with the keys.
The leds and blinkleds parameters are used to access (or flashing) and turn off the leds on the keyboard.
Normally there is one led for each function key.
To access (or flashing) and turn off the led you must assign to the code associated with the function key.
Every bit of the leds and blinkleds parameters is associated with an led.
The name of the parameter, state or command is shown at the left of the table.
R
Indicates if the parameter or state is retentive (upon initialization of the device maintains the previously defined state), or the state assumes upon initialization of the device.
If the device does not need to initialize the “R” field indicates the value that the parameter or state take to the power on of the card.
R = Retentive
0 = Upon initialization of the device the value is forced to zero.
1 = Upon initialization of the device the value is forced to one.
- = Upon initialization of the device is presented significant value.
D
Indicates the size of the parameter.
F = Flag
B = Byte
W = Word
L = Long
S = Single Float
Are described all the conditions that must exist is considered correct or because the command is accepted.
In some cases, limit values are specified for the acceptance of the parameter: If there are any values outside the limits set, the data is in any case accepted; therefore appropriate controls of the application must be provided to ensure the proper functioning.
To run a command, all conditions must be met; otherwise the command is not sent.
A
Indicates the access mode.
R = Read.
W = Write.
R-W= Read / Write.
| Nome | D | R | A | Condizioni | Descrizione |
|---|---|---|---|---|---|
| key | L | - | R | - | Key Rappresenta in ogni istante lo stato dei tasti. Ogni tasto è rappresentato da un bit. Per lassegnazione dei bit fare riferimento a quanto segue: KEY_1 268435456 KEY_2 1048576 KEY_3 4096 KEY_4 536870912 KEY_5 2097152 KEY_6 8192 KEY_7 1073741824 KEY_8 4194304 KEY_9 16384 KEY_0 8388608 KEY_CLR -2147483648 KEY_ENTER 128 KEY_HELP 64 KEY_DECPT 32 KEY_SIGN 16 KEY_ESC 33554432 KEY_UP 131072 KEY_PGUP 512 KEY_LEFT 67108864 KEY_NEXT 262144 KEY_RIGHT 1024 KEY_INS 134217728 KEY_DOWN 524288 KEY_PGDN 2048 |
| keyf | L | - | R | - | Function Key Rappresenta in ogni istante lo stato dei tasti funzione. Ogni tasto è rappresentato da un bit. Per lassegnazione dei bit fare riferimento a quanto segue: KEY_F1 33554432 KEY_F2 67108864 KEY_F3 134217728 KEY_F4 268435456 KEY_F5 536870912 KEY_F6 131072 KEY_F7 262144 KEY_F8 524288 KEY_F9 1048576 KEY_F10 2097152 KEY_F11 1 KEY_F12 2 KEY_F13 4 |
| Nome | D | R | A | Condizioni | Descrizione |
|---|---|---|---|---|---|
| leds | L | 0 | R-W | - | Leds status Parametro utilizzato per accendere i LED dei tasti funzione. Ogni bit del parametro è associato un LED. Per il valore associato al parametro keyf. |
| blinkleds | L | 0 | R-W | - | Blink Leds status Parametro utilizzato per far lampeggiare i LED dei tasti funzione. Ogni bit del parametro è associato un LED. Per il valore associato al parametro keyf. N.B. Perché un led possa lampeggiare è necessario associare il valore relativo a quel led sia al parametro leds che al parametro blinkleds. |
| Nome | D | R | A | Condizioni | Descrizione |
|---|---|---|---|---|---|
| language | B | R | R-W | - | Language Parametro per impostare la lingua da visualizzare. I valori vanno da 0 al numero di lingue introdotto -1. |
| Reverse | B | R | R-W | Non gestito nei display non grafici | Reverse Parametro per impostare la modalità reverse del display. Range 0÷1 |
| contrast | W | R | R-W | - | Contrast Parametro per impostare il contrasto del display. Range 1÷99. Default=33 Per valori prossimi a 99 il display appare scuro, mentre per valori prossimi a 1 appare chiaro. |
| clrtime | W | R | R-W | - | Clear time Parametro per impostare il tempo associato del tasto CLEAR. Durante l'inserimento di un dato, se il tasto CLEAR viene premuto per più di quel tempo, il dato introdotto viene azzerato. |
| error | B | 0 | R | - | Error Indica se vi sono errori nel device. In dettaglio: 0 = no error 1 = no application present 2 = checksum no match 3 = file format no match 4 = incorrect display size 5 = out of memory 6 = error readin the page 7 = error in erase operation 8 = internal error 9 = error in write memory 10 = error in read operation 11 = internal error 12 = image present but not possible 13 = font not supported 14 = internal error |
| memuse | B | 0 | R | - | Memory used Indica la percentuale di memoria utilizzata per memorizzare il file applicativo di QPAint. |
Nessuna limitazione.
; Accensione di un LED alla pressione del tasto funzione
; (si accende solo il LED F1 e tutti gli altri si spengono).
IF DEV:keyf EQ KEY_F1
DEV:leds = KEY_F1
ELSE
DEV:keyf EQ KEY_F1
ENDIF
; Accensione di due LED alla pressione di due tasti funzione
; (viene acceso/spento solo il LED relativo al tasto premuto).
IF DEV:keyf EQ KEY_F1
DEV:leds = DEV:leds ORB KEY_F1
ELSE
DEV:leds = DEV:leds ANDB (-1-KEY_F1)
ENDIF
IF DEV:keyf EQ KEY_F2
DEV:leds = DEV:leds ORB KEY_F2
ELSE
DEV:leds = DEV:leds ANDB (-1-KEY_F2)
ENDIF